package com.xjtu.se.homework.ops.link.controller;

import com.xjtu.se.homework.common.Result;
import com.xjtu.se.homework.ops.link.dto.LinkSearchDto;
import com.xjtu.se.homework.ops.link.service.LinkService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/ops/link")
public class LinkAPI {
    @Resource
    private LinkService linkService;

    @PostMapping("/getLogs")
    public Result getLogs(@RequestBody LinkSearchDto linkSearchDto) {
        System.out.println(linkSearchDto.getDev_id());
        System.out.println(linkSearchDto.getStart_time());
        System.out.println(linkSearchDto.getEnd_time());
        System.out.println(linkSearchDto.getU_id());
        return Result.success(linkService.getLogsByCondition(linkSearchDto));
    }
}
